1. Field of the Invention
This invention relates generally to disk drives, and more particularly to a magnetic recording disk drive that includes a nonvolatile memory for storing write data.
2. Description of the Related Art
Magnetic recording hard disk drives (HDDs) typically include, in addition to the rotating disk memory, solid state memory (referred to as “cache”) that temporarily holds write data transferred from the host computer before it is written to the disks. The conventional cache is dynamic random access memory (DRAM), a volatile form of memory that can undergo a significant number of write/erase cycles and that has a high data transfer rate.
The disk drive's data controller receives the write data from the host and controls the writing to the disks and the DRAM. The transfer of the write data to the DRAM is typically done using one of two conventional methods. In a first method, called “write-back caching” or “write-cache enabled”, the block of write data for a write command from the host is stored in DRAM, and write completion is signaled to the host when the block of write data has been received in the DRAM. The block of write data in DRAM is then later destaged from the DRAM and written to the disks. In a second method, sometimes called “write-through caching” or more commonly “write-cache disabled”, write completion is signaled to the host only after the block of write data has been written to the disks, using the cache mainly as a speed-matching buffer. Independent of write-cache enabled or disabled, disk drives today also support “command queuing”, in which multiple write commands may be received and waiting in a queue in the drive's controller. The controller transfers the blocks of write data for one or more of these waiting commands from the host into the DRAM, and signals write completion if write cache is enabled. If write cache is disabled, the controller then runs a program to determine when and which of the blocks of write data to destage to the disks. Only after a block of write data has been destaged to the disks does the controller signal write completion to the host.
With the advent of mobile computers that are battery powered, some HDDs have a “power-save” or “stand-by” mode wherein the disks spin down (stop rotating) when the drive has been inactive for a period of time. The main purpose of this mode is to extend the battery life of the mobile computer. When a disk drive is in standby mode, with just the electronics active, battery power is conserved. When write data is received from the host and must be written to the disks, the drive exits standby mode and the disks spin up to enable the write data to be written, which consumes a significant amount of battery power. If this occurs too frequently, there is no power saving.
One solution to this problem is to store the write data in the DRAM when the drive is in standby mode and the disks are not rotating, and then destage the write data to the disks at some later time, as in write-cache enabled. However, because DRAM is volatile memory, there is a risk that the write data in the DRAM can be lost if the drive loses power before the write data can be destaged to the disks. Thus it has been proposed to use nonvolatile memory, e.g., “flash” memory, in addition to or in place of DRAM in HDDs used in mobile computers. U.S. Pat. No. 6,295,577 describes a HDD that transfers write data in DRAM to flash memory in the event of a power failure. Because flash memory is nonvolatile, the write data will not be lost if power is lost. This type of HDD is sometimes called a “hybrid” disk drive. Hybrid HDDs use their flash memory for this mode of operation, i.e., the power-save mode. Thus the primary advantage of a hybrid disk drive is the ability to receive write data from the host without having to exit the standby mode, thereby conserving power and extending battery life, but without any risk of losing data in the event of a power failure. Hybrid HDDs also typically use the nonvolatile memory to store the computer's boot-up image so that on startup the boot-up image can be quickly loaded without having to wait for the disks to spin up. Application programs can similarly be stored in the nonvolatile memory of hybrid HDDs for fast application loading.
What is needed is a hybrid disk drive that uses the advantages provided by its nonvolatile memory to operate in modes other than the power-save mode.